package org.kele.sc2020.consumer.rpc;

import org.kele.sc2020.common.dto.KeleResult;
import org.kele.sc2020.consumer.rpc.fallback.ScProviderRPCfallback;
import org.kele.sc2020.consumer.rpc.interceptor.ScProviderRPCInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "sc-provider",
        fallbackFactory = ScProviderRPCfallback.class,
        configuration = ScProviderRPCInterceptor.class)
public interface ScProviderRPC {

    @GetMapping("/inner/get-info")
    String getFromProvider(@RequestParam("key") String key);

    @GetMapping("/inner/test-retry")
    KeleResult<Object> testRetry();
}
